package com.huawang.mdesign.model.service.util.reqif;

import com.huawang.mdesign.model.service.util.reqif.ref.SpecObjectRef;
import com.huawang.mdesign.model.service.util.reqif.ref.SpecRelationTypeRef;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamOmitField;
import lombok.Getter;
import lombok.Setter;

/**
 * Defines relations (links) between two  SpecObject instances.
 *
 * @author xdl
 * @since 2023-04-04
 */
@Getter
@Setter
@XStreamAlias(ReqIFConstants.SPEC_RELATION)
public class SpecRelation extends AbstractSpecElementWithAttributes {

    /**
     * Source object of the relationship.
     */
    @XStreamOmitField
    private SpecObject source;

    @XStreamAlias(ReqIFConstants.SOURCE)
    private SpecObjectRef sourceRef;

    /**
     * Target object of the relationship.
     */
    @XStreamOmitField
    private SpecObject target;

    @XStreamAlias(ReqIFConstants.TARGET)
    private SpecObjectRef targetRef;

    /**
     * Linkage to the concrete SpecType instance.
     */
    @XStreamOmitField
    private SpecRelationType type;

    @XStreamAlias(ReqIFConstants.TYPE)
    private SpecRelationTypeRef typeRef;

    /**
     * The back linkage to the owning ReqIFContent element.
     */
    @XStreamOmitField
    private ReqIFContent coreContent;
}
